<?php
/* Smarty version 3.1.33, created on 2018-10-09 09:54:49
  from 'C:\xampp\htdocs\20181009\test.html' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.33',
  'unifunc' => 'content_5bbc5ec9c047d6_85560156',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'c4001e97696499943f09d8f14f6963eddea8bc32' => 
    array (
      0 => 'C:\\xampp\\htdocs\\20181009\\test.html',
      1 => 1539071664,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5bbc5ec9c047d6_85560156 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'C:\\xampp\\htdocs\\20181009\\smarty-3.1.33\\libs\\plugins\\function.html_radios.php','function'=>'smarty_function_html_radios',),));
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
输出基础变量: <?php echo $_smarty_tpl->tpl_vars['username']->value;?>
<br>
输出点语法数组: <?php echo $_smarty_tpl->tpl_vars['arr']->value[0];?>
<br>
输出关联数组内容: <?php echo $_smarty_tpl->tpl_vars['arr2']->value['a'];?>
<br>
数组遍历: <br>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['arr2']->value, 'item');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['item']->value) {
if ($_smarty_tpl->tpl_vars['item']->value == 2) {?>
     数字是2<br>
<?php } else { ?>
     <?php echo $_smarty_tpl->tpl_vars['item']->value;?>
<br>
<?php }
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
数组遍历键和值：<br>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['arr2']->value, 'item', false, 'key');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['item']->value) {
echo $_smarty_tpl->tpl_vars['key']->value;?>
=====<?php echo $_smarty_tpl->tpl_vars['item']->value;?>

<?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>

<h1>显示单选框</h1>
<?php echo smarty_function_html_radios(array('name'=>"abc",'values'=>array('1','2'),'output'=>array('男','女'),'selected'=>'2'),$_smarty_tpl);?>

</body>
</html><?php }
}
